<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>menu decorate 测试</title>
<link href="../assets/menu.css" rel="stylesheet"/>
<link href="../assets/menuitem.css" rel="stylesheet"/>
<link href="../assets/submenu.css" rel="stylesheet"/>
<link href="../assets/filtermenu.css" rel="stylesheet"/>
<style>
    #menuTest {
        width: 300px;
    }

    .horizonal .goog-menuitem {
        float: left;
        width: 100px;
        overflow: hidden;
    }

    .horizonal {
        zoom: 1;
        overflow: hidden;
    }
</style>
</head>
<body>
<h1 style="text-align: center;">
    顶部导航菜单
</h1>
<div id="context" style="width: 500px;margin:50px auto;">

</div>
<script src="../../../build/kissy.js"></script>
<script>
    KISSY.Config.base = "../../";

    KISSY.use("menu", function(S, Menu) {
        var context = S.all("#context");

        var sb = new Menu.PopupMenu({
            prefixCls:"goog-"
        });

        sb.addChild(new Menu.Item({
            prefixCls:"goog-",
            content:"submenuitem1"}));
        sb.addChild(new Menu.Item({
            prefixCls:"goog-",
            content:"submenuitem2"}));

        sb.addChild(new Menu.Separator({
            prefixCls:"goog-"
        }));


        var sb2 = new Menu.PopupMenu({
            prefixCls:"goog-",
            autoHideDelay:300,
            children:[
                new Menu.Item({
                    prefixCls:"goog-",
                    content:"submenuitem141"})
            ],
            // bug elStyle 无效
            elStyle:{
                color:"red"
            }
        });
        sb2.addChild(new Menu.Item({
            prefixCls:"goog-",
            content:"submenuitem22"}));
        var b2 = new Menu.SubMenu({
            prefixCls:"goog-",
            content:"sub-sub-menu",
            menu:sb2
        });
        sb.addChild(b2);

        var b = new Menu.SubMenu({
            prefixCls:"goog-",
            content:"submenu",
            menuAlign:{
                offset:[-1,4],
                points:['bl','tl']
            },
            menu:sb
        });

        var menu = new Menu({
            prefixCls:"goog-",
            width:440,
            render:'#context',
            elCls:"horizonal",
            children:[b,new Menu.Item({
                prefixCls:"goog-",
                content:"alone"})]
        });


      

        menu.render();


    });

</script>
</body>
</html>